package aone

import "time"

type SatisfiedCodeOwnerRules struct {
	GlobRule     string      `json:"globRule"`
	Owners       []Author    `json:"owners"`
	RegexPattern interface{} `json:"regexPattern"`
	RegexRule    string      `json:"regexRule"`
}

type SatisfiedCheckResults struct {
	CheckName                 string                    `json:"check_name"`
	CheckStatus               string                    `json:"check_status"`
	CheckType                 string                    `json:"check_type"`
	ExtraUsers                []Author                  `json:"extra_users"`
	SatisfiedCodeOwnerRules   []SatisfiedCodeOwnerRules `json:"satisfied_code_owner_rules"`
	SatisfiedItems            []interface{}             `json:"satisfied_items"`
	UnsatisfiedCodeOwnerRules []interface{}             `json:"unsatisfied_code_owner_rules"`
	UnsatisfiedItems          []interface{}             `json:"unsatisfied_items"`
}

type ApproveCheckResult struct {
	SatisfiedCheckResults   []SatisfiedCheckResults `json:"satisfied_check_results"`
	TotalCheckResult        string                  `json:"total_check_result"`
	UnsatisfiedCheckResults []interface{}           `json:"unsatisfied_check_results"`
}

type Attributes struct {
	AttributeInfo  string `json:"attributeInfo"`
	AttributeType  string `json:"attributeType"`
	GmtCreate      string `json:"gmtCreate"`
	GmtModified    string `json:"gmtModified"`
	ID             int    `json:"id"`
	IsDeleted      bool   `json:"isDeleted"`
	OrganizationID string `json:"organizationId"`
	ProjectID      int    `json:"projectId"`
	SourceID       int    `json:"sourceId"`
	SourceType     string `json:"sourceType"`
}

type Milestone struct {
	CreatedAt   string `json:"created_at"`
	Description string `json:"description"`
	DueDate     string `json:"due_date"`
	ID          int    `json:"id"`
	Iid         int    `json:"iid"`
	ProjectID   int    `json:"project_id"`
	State       string `json:"state"`
	Title       string `json:"title"`
	UpdatedAt   string `json:"updated_at"`
}

type PatchCommands struct {
	Checkout   string `json:"checkout"`
	Cherrypick string `json:"cherrypick"`
}

type Assignees struct {
	AvatarURL      string `json:"avatar_url"`
	Email          string `json:"email"`
	ExternUID      string `json:"extern_uid"`
	ID             int64  `json:"id"`
	MergeRequestID int64  `json:"merge_request_id"`
	Name           string `json:"name"`
	State          string `json:"state"`
	Status         string `json:"status"`
	Username       string `json:"username"`
	WebURL         string `json:"web_url"`
}

type Author struct {
	AvatarURL string `json:"avatar_url"`
	Email     string `json:"email"`
	ExternUID string `json:"extern_uid"`
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	State     string `json:"state"`
	Username  string `json:"username"`
	WebURL    string `json:"web_url"`
}

type CodeReviewScale struct {
	AddedLineCount   int64 `json:"added_line_count"`
	DeletedLineCount int64 `json:"deleted_line_count"`
}

type MergeRequest struct {
	AcceptedRevision       string             `json:"accepted_revision"`
	ApproveCheckResult     ApproveCheckResult `json:"approve_check_result"`
	Assignee               Author             `json:"assignee"`
	Assignees              []Assignees        `json:"assignees"`
	Attributes             []Attributes       `json:"attributes"`
	Author                 Author             `json:"author"`
	ClosedComments         int64              `json:"closedComments"`
	CodeOwnerMode          string             `json:"code_owner_mode"`
	Comments               int64              `json:"comments"`
	CreatedAt              time.Time          `json:"created_at"`
	CreationMethod         string             `json:"creation_method"`
	Description            string             `json:"description"`
	DetailURL              string             `json:"detail_url"`
	DiffTooLarge           bool               `json:"diff_too_large"`
	Downvotes              int64              `json:"downvotes"`
	EmailGroups            []interface{}      `json:"email_groups"`
	ID                     int64              `json:"id"`
	Iid                    int64              `json:"iid"`
	IsConflicted           bool               `json:"is_conflicted"`
	IsSupportChangeState   bool               `json:"is_support_change_state"`
	IsSupportClose         bool               `json:"is_support_close"`
	IsSupportMerge         bool               `json:"is_support_merge"`
	IsSupportModify        bool               `json:"is_support_modify"`
	IsSupportReassign      bool               `json:"is_support_reassign"`
	IsSupportReopen        bool               `json:"is_support_reopen"`
	IsSupportWorkitem      bool               `json:"is_support_workitem"`
	IsUsePushBlock         bool               `json:"is_use_push_block"`
	Labels                 []interface{}      `json:"labels"`
	LocalBranch            string             `json:"local_branch"`
	MergeStatus            string             `json:"mergeStatus"`
	MergeBase              string             `json:"merge_base"`
	MergeError             string             `json:"merge_error"`
	MergeWhenBuildSucceeds bool               `json:"merge_when_build_succeeds"`
	MergedRevision         string             `json:"merged_revision"`
	Milestone              Milestone          `json:"milestone"`
	PatchCommands          PatchCommands      `json:"patch_commands"`
	ProjectID              int64              `json:"project_id"`
	ProjectPath            string             `json:"project_path"`
	RefOldOid              string             `json:"ref_old_oid"`
	SourceBranch           string             `json:"source_branch"`
	SourceBranchExist      bool               `json:"source_branch_exist"`
	SourceProjectID        int64              `json:"source_project_id"`
	SourceType             string             `json:"source_type"`
	SSHURLToRepo           string             `json:"ssh_url_to_repo"`
	State                  string             `json:"state"`
	Subscribers            []Author           `json:"subscribers"`
	SupportMergeFfOnly     bool               `json:"support_merge_ff_only"`
	TargetBranch           string             `json:"target_branch"`
	TargetBranchExist      bool               `json:"target_branch_exist"`
	TargetProjectID        int64              `json:"target_project_id"`
	Title                  string             `json:"title"`
	UpdatedAt              time.Time          `json:"updated_at"`
	Upvotes                int64              `json:"upvotes"`
	WarningMessage         string             `json:"warning_message"`
	WebURL                 string             `json:"web_url"`
	WorkInProgress         bool               `json:"work_in_progress"`
}
